package example.strategy.rreversible;

import com.scop.desensitize.strategy.rreversible.asymmetric.DsaStrategy;
import org.apache.log4j.Logger;

/**
 * @desc   DsaStrategy测试类
 * @author BuffPlum
 * @time 2022-04-24
 */
public class DsaStrategyDemo {
    public static Logger log = Logger.getLogger(DsaStrategyDemo.class);
    public static void main(String[] args) throws Exception {
        DsaStrategy dsa = DsaStrategy.getInstance();//初始化策略类
        String str="芜湖";
        String sgin = dsa.encode(str);//将数据进行加密生成签名
        System.out.println(sgin);
        String str2="芜湖x";
        String str3="芜湖";
        Boolean flag = dsa.verifySignature(str2, sgin);//签名比对
        Boolean flag2 = dsa.verifySignature(str3, sgin);
        log.info(flag);
        log.info(flag2);

    }
}
